﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Cinemax.DTO;
using Cinemax.DAO;

namespace Cinemax
{
    public partial class choose_seat : System.Web.UI.Page
    {
        public int SoHang = 10;
        public int SoDay = 10;
        public PhongChieuDTO pc = new PhongChieuDTO();
        public List<VeDTO> dsVe = new List<VeDTO>();
        public List<int> dsVeTrong = new List<int>();
        public int maPhong = -1;
        public int maSuatChieu = -1;

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                
                if (Request.QueryString["Phong"] != null)
                {
                    maPhong = int.Parse(Request.QueryString["Phong"]);
                    pc = PhongChieuDAO.GetPhongChieuByID(maPhong);
                    SoHang = pc.SoLuongHang;
                    SoDay = pc.SoLuongDay;
                    Session["mp"] = maPhong;
                }
                
                if (Request.QueryString["SuatChieu"] != null)
                {
                    maSuatChieu = int.Parse(Request.QueryString["SuatChieu"]);
                    dsVe = VeDAO.getAllTicket(maSuatChieu);
                    dsVeTrong = VeDAO.getAllIDTicketEmpty(maSuatChieu);
                    Session["msc"] = maSuatChieu;
                }
            }
            catch (Exception)
            {
                Response.Redirect("home.aspx");
            }

        }
    }
}